﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls.CommonTables.SC.DCYY
{
    /// <summary>
    /// JiaoJieJiLuCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class JiaoJieJiLuCtrl : CustomCommonTableCtrl
    {
        public JiaoJieJiLuCtrl()
        {
            InitializeComponent();
            if (DataManager.Instance.CurrentPatientLink != null)
            {
                sssj.Text = DataManager.Instance.CurrentPatientLink.Status.InRoomTime.Equals(new DateTime()) ? "" : DataManager.Instance.CurrentPatientLink.Status.InRoomTime.ToString(DateFormat.DATE_FORMAT_STR_YMD_CN);
                rssj.Text = DataManager.Instance.CurrentPatientLink.Status.InPacuTime.Equals(new DateTime()) ? "" : DataManager.Instance.CurrentPatientLink.Status.InPacuTime.ToString(DateFormat.DATE_FORMAT_STR_YMDHM);
            }
           
            IniteRadioBation();
        }
        private void sssj_GotFocus(object sender, RoutedEventArgs e)
        {
            CustomTextCtrl cuText = sender as CustomTextCtrl;
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;

            cusDatePicker.ShowDialog();

            if (cusDatePicker.Result)
            {
                cuText.Value = cusDatePicker.SelectedDateTime;//2005年11月5日
            }
        }
        private void IniteRadioBation()
        {
            new RadioButtonHelper().ChangeRadioSatus(jshzt_jiah, jshzt_ch );
         
            new RadioButtonHelper().ChangeRadioSatus(xil_pj, xil_jz); new RadioButtonHelper().ChangeRadioSatus(shshs_w, shshs_y);
            new RadioButtonHelper().ChangeRadioSatus(pf_wh, pf_yc); new RadioButtonHelper().ChangeRadioSatus(jshzt_dm, jshzt_zhai);
            new RadioButtonHelper().ChangeRadioSatus(xil_pj2, xil_jz2); new RadioButtonHelper().ChangeRadioSatus(xil_jl2, xil_kj2);
            new RadioButtonHelper().ChangeRadioSatus(xil_jl, xil_kj); new RadioButtonHelper().ChangeRadioSatus(pf_pj2, pf_jz2);
            new RadioButtonHelper().ChangeRadioSatus(ssbw_jl2, ssbw_kj2); new RadioButtonHelper().ChangeRadioSatus(shshs_w2, shshs_y2);
            new RadioButtonHelper().ChangeRadioSatus(tc_jl2, tc_kj2); new RadioButtonHelper().ChangeRadioSatus(pf_wh2, pf_yc2);
            new RadioButtonHelper().ChangeRadioSatus(fxpg2, gfx_w2); new RadioButtonHelper().ChangeRadioSatus(qm2, zgnmz2);
            new RadioButtonHelper().ChangeRadioSatus(bwt2,sw2); new RadioButtonHelper().ChangeRadioSatus(lfj2, wys2);
            new RadioButtonHelper().ChangeRadioSatus(ssdy_w2, ssdy_y2); new RadioButtonHelper().ChangeRadioSatus(blzl_w, blzl_y);
            new RadioButtonHelper().ChangeRadioSatus(blzl_ywz, blzl_bwz); new RadioButtonHelper().ChangeRadioSatus(yxzl_w, yxzl_y);
            new RadioButtonHelper().ChangeRadioSatus(ks_qcs2, ks_ysz2); new RadioButtonHelper().ChangeRadioSatus(ssbw_jl, ssbw_kj);
            new RadioButtonHelper().ChangeRadioSatus(shshs_w, shshs_y); new RadioButtonHelper().ChangeRadioSatus(tc_jl, tc_kj);
            new RadioButtonHelper().ChangeRadioSatus(fxpg, gfx_w); new RadioButtonHelper().ChangeRadioSatus(qm, zgnmz);
            new RadioButtonHelper().ChangeRadioSatus(bwt, sw); new RadioButtonHelper().ChangeRadioSatus(ssdy_w, ssdy_y);
            new RadioButtonHelper().ChangeRadioSatus(bwtys, swfs); new RadioButtonHelper().ChangeRadioSatus(lfyn,lffn);
            new RadioButtonHelper().ChangeRadioSatus(fws, gfx_wys); new RadioButtonHelper().ChangeRadioSatus(fxpg, gfx_w);
            new RadioButtonHelper().ChangeRadioSatus(JCB14, JCB15); new RadioButtonHelper().ChangeRadioSatus(JCB16, JCB17);
            new RadioButtonHelper().ChangeRadioSatus(JCB19, JCB20); new RadioButtonHelper().ChangeRadioSatus(ssdy_w, ssdy_y);
            new RadioButtonHelper().ChangeRadioSatus(bwt, sw); new RadioButtonHelper().ChangeRadioSatus(ks_qcs, ks_ysz);

        }
        private void jjsj2_GotFocus(object sender, RoutedEventArgs e)
        {
            CustomTextCtrl cuText = sender as CustomTextCtrl;
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;

            cusDatePicker.ShowDialog();

            if (cusDatePicker.Result)
            {
                cuText.Value = cusDatePicker.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMDHM);//2005年11月5日
            }
        }
    }
}
